package com.xpsoft.oa.service.produce.impl;


import java.util.List;

import com.xpsoft.core.service.impl.BaseServiceImpl;
import com.xpsoft.oa.dao.produce.ArticleReceiveDao;
import com.xpsoft.oa.model.produce.ArticleReceive;
import com.xpsoft.oa.service.produce.ArticleReceiveService;

public class ArticleReceiveServiceImpl extends BaseServiceImpl<ArticleReceive> implements ArticleReceiveService{
	private ArticleReceiveDao dao;
	
	public ArticleReceiveServiceImpl(ArticleReceiveDao dao) {
		super(dao);
		this.dao=dao;
	}

	@Override
	public ArticleReceive getByRegId(Long regId) {
		// TODO Auto-generated method stub
		String hql = "from ArticleReceive where articleReg.id=?";
		List<ArticleReceive> receiveList = dao.findByHql(hql, new Object[]{regId});
		if(receiveList!=null&&receiveList.size()>0){
			return receiveList.get(0);
		}
		return null;
	}

	
}